home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / Halftone.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-09-18  |  2.1 KB  |  84 lines

  1. /**********************************/
  2. /* Halftone V2.11                 */
  3. /* Image Engineer Macro script    */
  4. /* by Simon Edwards               */
  5. /* 3/6/95                         */
  6. /*                                */
  7. /* This lets you select an alpha  */
  8. /* channel image to be scaled and */
  9. /* used as a halftone pattern on  */
  10. /* the project.                   */
  11. /*                                */
  12. /* MS: now uses zoomlevel of      */
  13. /*     original picture           */
  14. /*                                */
  15. /**********************************/
  16.  
  17. Options results
  18. signal on error         /* Setup a place for errors to go */
  19.  
  20. if arg()==0 then exit
  21. pic=arg(1)
  22.  
  23. PROJECT_INFO pic WIDTH
  24. picwidth=result
  25. PROJECT_INFO pic HEIGHT
  26. picheight=result
  27. PROJECT_INFO pic ZOOM
  28. origzoomval=result
  29.  
  30. 'FORM "Halftone" "Ok|Cancel"',
  31. 'RADIO,"Pattern","Spherical|Vertical|Horizontal|Diagonal|Ordered4|Wavey",0',
  32. 'INTEGER,"Size in pixels",4,256,16,SLIDER'
  33.  
  34. parse var result ok reply size .
  35. if ok=0 then exit
  36.  
  37. alp = 'IE:Alpha/'
  38.  
  39. select
  40.   when reply==0 then alp = alp'Spherical.alpha'
  41.   when reply==1 | reply==2 then alp = alp'Gradient.alpha'
  42.   when reply==3 then alp = alp'Diagonal.alpha'
  43.   when reply==4 then alp = alp'Ordered4.alpha'
  44.   when reply==5 then alp = alp'Wavey.alpha'
  45.   otherwise exit
  46. end
  47.  
  48. 'OPEN "'alp'" 8BIT'
  49. alphachannel=result
  50.  
  51. PROJECT_SET alphachannel ZOOM origzoomval
  52.  
  53.  
  54. 'SCALE' alphachannel size size 'FAST'
  55. sizedalpha=RESULT
  56. 'CLOSE' alphachannel
  57.  
  58. 'MARK' pic  'PRIMARY'
  59. 'MARK' sizedalpha 'ALPHA'
  60. 'HALFTONE'
  61. 'CLOSE' sizedalpha
  62.  
  63. exit
  64.  
  65.  
  66. /*******************************************************************/
  67. /* This is where control goes when an error code is returned by IE */
  68. /* It puts up a message saying what happened and on which line     */
  69. /*******************************************************************/
  70. error:
  71. if RC=5 then do         /* Did the user just cancel us? */
  72.     IE_TO_FRONT
  73.     LAST_ERROR
  74.     'REQUEST "'||RESULT||'"'
  75.     exit
  76. end
  77. else do
  78.     IE_TO_FRONT
  79.     LAST_ERROR
  80.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  81.     exit
  82. end
  83.  
  84.